﻿﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace vlcplay.Logging
{
    using Microsoft.Extensions.Logging;
    using System;

    public class FileLoggerProvider : ILoggerProvider
    {
        private readonly Func<string, LogLevel, bool> _filter;
        private readonly string _logDirectory;

        public FileLoggerProvider(string logDirectory, Func<string, LogLevel, bool>? filter = null)
        {
            _logDirectory = logDirectory;
            _filter = filter ?? ((category, level) => true);
        }

        public ILogger CreateLogger(string categoryName)
        {
            return new FileLogger(categoryName, _logDirectory, _filter);
        }

        public void Dispose()
        {
        }
    }
}
